<!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8">
		<title></title>
	</head>
	<body>

		<button onclick="foo1()">弹出警告框</button>
		<button onclick="foo2()">弹出询问框</button>
		<button onclick="foo3()">弹出输入框</button>
		<script>
			function foo1() {
				window.alert("你好")
			}

			function foo2() {
				var result = window.confirm("确认删除么")
				if (result) {
					alert("文件已经删除了！")
				} else {
					alert("取消了操作！")
				}
			}

			function foo3() {
				var result = prompt("1+2=")
				if (result == 3) {
					alert("计算正确")
				} else {
					alert("计算错误")
				}
			}
		</script>
	</body>
</html>